#!/usr/bin/env python

from google.appengine.ext import webapp, db
from google.appengine.ext.webapp.util import run_wsgi_app

from google.appengine.api import users

class AdminPage(webapp.RequestHandler):
    def get(self):
        user = users.get_current_user()
        
        greeting = ("Welcome, %s! (<a href=\"%s\">sign out</a>)" %
                    (user.nickname(), users.create_logout_url("/")))
        
        self.response.out.write("<html><body>%s</body></html>" % greeting)

application = webapp.WSGIApplication([
    (r'/admin/', AdminPage),
], debug=True)

def main():
    run_wsgi_app(application)        